#pragma once

#include "Actor.h"
#include "Color4.h"
#include "ParticleEmitter.h"

#define PARTICLE_DEFAULT_LIFETIME		1.0f
#define PARTICLE_DEFAULT_AGE			0.0f
#define	PARTICLE_DEFAULT_COLOR			Color4::White
#define	PARTICLE_DEFAULT_SIZE			Vector2f::One

enum InterpolationType
{
	INTERPOLATIONTYPE_Linear,
	INTERPOLATIONTYPE_Spline
};

class ValueTimes
{
public:
	void				GetValueAtTime(float time);
public:
	int					Count;
	int					Stride;
	float*				Data;
	float*				Time;
	InterpolationType	InterpolationType;
};

class Particle : public Actor
{
public:
	Particle();
public:
	~Particle();
public:
	void					Update(float elapsedTime);
public:
	const ParticleEmitter*	GetParticleEmitter() const;
	const float				GetLifetime() const;
	const float				GetAge() const;
	const Color4			GetColor() const;
	const Vector2f			GetScale() const;
public:
	const bool				IsAlive() const;
	const bool				IsDead() const;
private:
	ParticleEmitter*		m_pParticleEmitter;
	float					m_fLifetime;
	float					m_fAge;
	Color4					m_oColor;
	Vector2f				m_vScale;
};
